Skip to content

Add ROCm CI job with VecGeom 2.3 built with HIP - #53

Draft
esseivaju wants to merge 9 commits into
celeritas-project:mainfrom
esseivaju:ci/rocm-vecgeom-2.3
Draft

esseivaju wants to merge 9 commits into
celeritas-project:mainfrom
esseivaju:ci/rocm-vecgeom-2.3

Conversation

@esseivaju

@esseivaju esseivaju commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Depends on #52. This branch is built on top of it, so this PR shows #52's commits until #52 merges. The changes specific to this PR are 01bc3b3, 747a81b and 990e2a1. The two commits after them (b995beb, 33a9aad) are copies of #52's review changes.

VecGeom 2.3 (wip/gpu-portability, VecGeom MR 1689) adds a HIP backend. This PR adds a build-full job that builds G4VG against a HIP-enabled VecGeom 2.3 in the Celeritas ROCm CI image.

Changes

  • build-full.yml: new ubuntu-rocm matrix entry (debug and ndebug) using ghcr.io/celeritas-project/ci-rocm:2026-11-12, which has ROCm 7.2.4 and Geant4 11.3.
    • The image has no VecGeom, so the job builds it from the same pinned commit as build-spack (9cb15a8a). Settings: VECGEOM_ENABLE_HIP=ON, ROCm clang++ as the C++ and HIP compiler, CMAKE_HIP_ARCHITECTURES=gfx90a (the same architecture as Celeritas's ROCm preset), and VecGeom's bundled VecCore.
    • The VecGeom install is cached by actions/cache, keyed on the VecGeom commit and the image date, so the roughly 4.5-minute HIP build only happens once.
    • A new "Check VecGeom version" step writes G4VG_VECGEOM_VERSION to the job summary for both images.
  • scripts/cmake-presets/ci-ubuntu-rocm.json (new): G4VG presets that use the ROCm clang++, based on Celeritas's ci-ubuntu-rocm.json.
  • build-spack.yml: a comment saying to keep VECGEOM_2_3_COMMIT in sync with build-full.yml.

G4VG itself needs no CMake changes. It doesn't enable HIP, so it links VecGeom like a library without device code. VecGeom's package config loads its own HIP-capable CudaRdcUtils (v15), so G4VG's bundled copy (v14) isn't used, and this doesn't depend on celeritas-project/celeritas#2703.

Workarounds for review

  • VecGeom is built as static libraries. The shared HIP build of VecGeom fails to link libvecgeom.so with ROCm 7.2.4:
    ld.lld: error: undefined hidden symbol: __hip_gpubin_handle_f06313777b8e3bc7
    
    The MR reports HIP validation only on ROCm 10.1. This should be reported on VecGeom MR 1689. Once shared builds work, the job can switch back to BUILD_SHARED_LIBS=ON.
  • CMAKE_CXX_SCAN_FOR_MODULES=OFF in the ROCm preset. Geant4 in the image requires C++20, so CMake scans for C++20 modules, and ROCm has no clang-scan-deps. The Spack presets in Test VecGeom 2.3 in CI and move Docker job to ghcr #52 use the same workaround.
  • VecGeom's build directory is cached as well (/opt/vecgeom-build/installExternals). VecGeom's package config points to the bundled VecCore installed in its build directory, not in the install prefix.

Testing

All of these were run on the fork via workflow_dispatch:

  • With VecGeom built from source (run): all four build-full jobs passed. The ROCm jobs show "HIP support enabled", VecGeom 2.3.0 found, G4VG_VECGEOM_VERSION 0x20300, and 11/11 tests passed. The runners have no AMD GPU, so tests run on the host only.
  • With VecGeom restored from the cache (run): all four jobs passed, and the VecGeom build step was skipped.

🤖 Generated with Claude Code

esseivaju and others added 7 commits December 2, 2026 11:09
- Add a spack-based build-spack workflow testing VecGeom 2.3 (pinned
  wip/gpu-portability commit, overridable via workflow_dispatch) against
  Geant4 10.5 and 11.4, plus VecGeom 1.2.11 against Geant4 11.3. The spack
  setup is adapted from Celeritas so that Geant4 is pulled from the
  Celeritas spack buildcache.
- Move the Docker job to ghcr.io/celeritas-project/ci-cuda:2026-11-12
  (VecGeom 2.2 +cuda, CUDA 13) and build for sm_80.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G4VG supports C++17 (required for Geant4 10.5), where designated
initializers are a -pedantic error under clang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G4PVDivision only overrides GetMultiplicity since Geant4 10.6: before
that the base class returns 1, so only one copy of each division was
placed. Use the number of replicas from the replication data instead.
Found by the new Geant4 10.5 CI job (ZnenvTest.default_options).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Celeritas ci-rocm image has no VecGeom, so build the pinned VecGeom
2.3 development commit with VECGEOM_ENABLE_HIP (gfx90a, ROCm clang++) in
the job and cache the installation. G4VG is built with the ROCm clang++
against it; VecGeom's config loads its HIP-capable CudaRdcUtils (v15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linking the shared libvecgeom.so with HIP device code fails with ROCm 7.2
(undefined hidden __hip_gpubin_handle_* symbols).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The image Geant4 requires C++20, so disable module scanning since ROCm
  has no clang-scan-deps.
- VecGeom config points to its builtin VecCore in the build directory:
  build in /opt/vecgeom-build and cache its installExternals too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@esseivaju esseivaju added documentation Improvements or additions to documentation and/or CI enhancement New feature or request labels Dec 2, 2026
@esseivaju
esseivaju marked this pull request as draft December 2, 2026 21:33
esseivaju and others added 2 commits December 3, 2026 08:45
This reverts commit b114966, which will be submitted separately. The
Geant4 10.5 job fails ZnenvTest until that fix is merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation and/or CI enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant